package com.zhiqianbao.utils;

import android.util.Log;

/**
 * Created by liudehong on 2017/11/22.
 * 控制未上线打印，上线关闭log日志
 */
public class LogUtils {
    public static boolean isDebug=true;

    public static void d(String tag,String msg){
        if (isDebug) {
            Log.d(tag, msg);
        }
    }

    public static void i(String tag,String msg){
        if (isDebug) {
            Log.i(tag, msg);
        }
    }

    public static void v(String tag,String msg){
        if (isDebug) {
            Log.v(tag, msg);
        }
    }

    public static void e(String tag,String msg){
        if (isDebug) {
            Log.e(tag, msg);
        }
    }

    public static String getTag(String url){
        int indexOfs=url.indexOf("mimidai-api");
        String tag="";
        if(indexOfs!=0){
            if(url.length()>(indexOfs+11)){
                tag=url.substring(indexOfs+11,url.length())+"....";
            }
            else{
                tag="result....";
            }
        }
        return tag;
    }
}
